package cn.cainiao.Util;

import cn.cainiao.dao.IPageDao;
import cn.cainiao.dao.impl.PageDaoImpl;
import cn.cainiao.entity.UserInfo;

import java.util.Scanner;

public class Pageutil extends PageDaoImpl {
    Scanner in = new Scanner(System.in);

    /**
     * 登录
     */
    public void login(){
        System.out.println("请输入用户名");
        String username =in.next();
        System.out.println("请输入密码");
        String password=in.next();
        IPageDao iPageDao = new PageDaoImpl();
        UserInfo user= iPageDao.login(username,password);
        if (user!=null){
            usernameA = user.getUsername();
            passwordA=user.getPassword();
            System.out.println("登陆成功，欢迎您" + user.getUsername());
        } else {
            System.out.println("用户名或密码输入不正确");
        }
    }
}
